package common.zsxmlv.vo.im;

/**
 * @Author: ZSXM
 * @Description: layui layim message
 * @Company: DingZheng
 * @Date: Create by 2018/6/14 2:08
 * @Version: 1.0
 * @Modify by:
 */
public class Message {

    /**
     * 消息来源用户名
     */
    private String username;

    /**
     * 消息来源用户头像
     */
    private String avatar;

    /**
     * 消息的来源ID（如果是私聊，则是用户id，如果是群聊，则是群组id）
     */
    private String id;

    /**
     * 聊天窗口来源类型，从发送消息传递的to里面获取
     */
    private String type;

    /**
     * 消息内容
     */
    private String content;

    /**
     * 消息id，可不传。除非你要对消息进行一些操作（如撤回）
     */
    private String cid;

    /**
     * 是否我发送的消息，如果为true，则会显示在右方
     */
    private boolean mine;

    /**
     * 消息的发送者id（比如群组中的某个消息发送者），可用于自动解决浏览器多窗口时的一些问题
     */
    private String fromid;

    /**
     * 服务端时间戳毫秒数。注意：如果你返回的是标准的 unix 时间戳，记得要 *1000
     */
    private long timestamp;


    // 以下非layui layim 字段
    /**
     * 消息类型<br/>
     * 1、状态栏
     * 2、alert 提示
     */
    private Integer msgType;

    /**
     * 提示信息
     */
    private String msg;

    /**
     * 附加参数
     */
    private Object attach;


    public Message() {
    }

    public Message(String username, String avatar, String id, String type, String content, String cid, boolean mine, String fromid, long timestamp, Integer msgType, String msg, Object attach) {
        this.username = username;
        this.avatar = avatar;
        this.id = id;
        this.type = type;
        this.content = content;
        this.cid = cid;
        this.mine = mine;
        this.fromid = fromid;
        this.timestamp = timestamp;
        this.msgType = msgType;
        this.msg = msg;
        this.attach = attach;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCid() {
        return cid;
    }

    public void setCid(String cid) {
        this.cid = cid;
    }

    public boolean isMine() {
        return mine;
    }

    public void setMine(boolean mine) {
        this.mine = mine;
    }

    public String getFromid() {
        return fromid;
    }

    public void setFromid(String fromid) {
        this.fromid = fromid;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public Integer getMsgType() {
        return msgType;
    }

    public void setMsgType(Integer msgType) {
        this.msgType = msgType;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getAttach() {
        return attach;
    }

    public void setAttach(Object attach) {
        this.attach = attach;
    }

    @Override
    public String toString() {
        return "Message{" +
                "username='" + username + '\'' +
                ", avatar='" + avatar + '\'' +
                ", id='" + id + '\'' +
                ", type='" + type + '\'' +
                ", content='" + content + '\'' +
                ", cid='" + cid + '\'' +
                ", mine=" + mine +
                ", fromid='" + fromid + '\'' +
                ", timestamp=" + timestamp +
                ", msgType=" + msgType +
                ", msg='" + msg + '\'' +
                ", attach=" + attach +
                '}';
    }
}
